﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Jspay.aspx.cs" Inherits="Page_OrderPay_Jspay" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <script src="../../Scripts/jquery-1.8.0.min.js"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <title>就诊卡缴费</title>
    <link href="../../Content/syzyy/css/reset.css" rel="stylesheet" />
    <link href="../../Content/syzyy/css/ylt_common.css" rel="stylesheet" />
    <link href="../../layui/css/layui.css" rel="stylesheet" />

    <script src="../../Scripts/jquery-1.8.0.min.js"></script>
    <script src="../../Scripts/jquery.form.js"></script>
    <%--layui--%>
    <script src="../../layui/layui.js"></script>
    <script src="../../Content/syzyy/js/additional-methods.js"></script>
    <style type="text/css">
        body {
            background-color: #fff;
        }

        .btn-white {
            display: inline-block;
            background-color: #fff;
            color: #78b830;
            border: 1px solid #78b830;
            border-radius: .078rem;
            width: 100%;
            line-height: 4.05rem;
            font-size: 3.4rem;
            border-radius: 3px;
        }
    </style>
</head>
<body>
    <header class="appoint_header">
        <img class="appoint_icon" src="../../Content/syzyy/img/hos_fee.png" />
        <div class="tips_con">
            <h5 class="appointment_status">就诊卡缴费</h5>
            <p class="appointment_tips">
                建卡成功以后，就诊当天请携带身份证，在收费窗口更换实体卡	
            </p>
        </div>
    </header>
    <form class="layui-form" id="" name="" action="" enctype="multipart/form-data" method="post">

        <table style="margin-left: 4%; font-size: 3.4rem;">
            <tr style="height: 55px;">
                <td>收费项目</td>
                <td>沭阳妇幼保健院就诊卡</td>
            </tr>
            <tr style="height: 55px;">
                <td>金额</td>
                <td>2元</td>
            </tr>
        </table>

    </form>
    <div align="center">
        <button id="pay" onclick="callpay()" style="width: 210px; height: 50px; border-radius: 15px; background-color: #00CD00; border: 0px #FE6714 solid; cursor: pointer; color: white; font-size: 16px;">立即支付</button>
    </div>

    <script type="text/javascript">

        //调用微信JS api 支付
        function jsApiCall() {
            $("#pay").text("微信支付连接中...");
            $("#pay").attr('disabled', true);
            WeixinJSBridge.invoke(
            'getBrandWCPayRequest',
            <%=wxJsApiParam%>,//josn串
            function (res)
            {
                if (res.err_msg == "get_brand_wcpay_request:ok") {
                    alert("支付成功");
                    location.href = "<%=MainUrl%>" + "/page/Customer/AllPatient.aspx?from=jspay";
                }

                if (res.err_msg == "get_brand_wcpay_request:cancel") {
                    alert("支付取消");
                    $("#pay").text("立即支付");
                    $("#pay").attr('disabled', false);
                }
                if (res.err_msg == "get_brand_wcpay_request:fail") {
                    alert("支付失败");
                    $("#pay").text("支付失败");
                    $("#pay").attr('disabled', false);
                }
            });
        }

        function callpay()
        {
            if (typeof WeixinJSBridge == "undefined")
            {
                if (document.addEventListener)
                {
                    document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                }
                else if (document.attachEvent)
                {
                    document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                    document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                }
            }
            else
            {
                jsApiCall();
            }
        }
    </script>
</body>
</html>

